package com.hdsx.netty.rpcserver.netty.provider;

import com.hdsx.netty.api.OrderServer;
import com.hdsx.netty.api.bean.Order;

import java.util.UUID;

/**
 * @author 占贤银
 * time 2024/8/13 23:33
 * description 生命之灯因热情而点燃，生命之舟因拼搏而前行
 */
public class OrderServerImpl implements OrderServer {
    @Override
    public String getOrderMsg() {
        return "我是Netty订单！";
    }

    @Override
    public String getOrderMsg(String id) {
        return "我是Netty订单，id = " + id;
    }

    @Override
    public Order getOrder() {
        Order order = new Order(UUID.randomUUID().toString(), "Netty");
        return order;
    }

    @Override
    public Order getOrder(Order order) {
        if (order != null) {
            return order;
        }
        return new Order("000000000000", "没有订单信息可读！");
    }
}
